package com.mew.sas.config;


import com.mew.common.dc.db.*;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

@Service
@Slf4j
public class StartGameConfigService {

    @Autowired
    private GameRoomService gameRoomService;
    @Autowired
    private MewErrorConfigService petrelConfigService;
    @Autowired
    private LevelConfigService levelConfigService;
    @Autowired
    private ControlService controlService;

    @Autowired
    private FishingConfigService fishingConfigService;
    @Autowired
    private GoldBuyService goldBuyService;
    @Autowired
    private BulletinService bulletinService;
    @Autowired
    private AgentConfigDBService  agentConfigDBService;
    @Autowired
    private UserService userService;


    public void startLoad() throws Exception {
        //load server game info
        levelConfigService.loadLevel();
        gameRoomService.loadRoomGame();
        petrelConfigService.loadErrorCode();

        //load control
        controlService.loadAllControlUser();
        controlService.loadAllControlRoom();
        controlService.loadAllControlSpecial();

        //load fishing
        fishingConfigService.loadFish();
        fishingConfigService.lodeQmcs();

        //lode gold config
        goldBuyService.lodeJewelProduct();
        goldBuyService.lodeMoneyProduct();

        //lode agent config
        agentConfigDBService.loadAgentConfig();

        //sys
        bulletinService.lodeBulletin();
        //customer
//        userService.loadCustomer();
    }

    public void startLoadControl(){
        controlService.loadAllControlUser();
        controlService.loadAllControlRoom();
        controlService.loadAllControlSpecial();
    }
}
